<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AlterAgentFinanceDailyAddJiesuan extends Migrator
{
    public function up()
    {

        $this->table('agent_finance_daily')
            ->addColumn('settle_amount', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '今日结算'])
            ->addColumn('order_num', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '订单数'])
            ->addColumn('trade_amount', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '交易额'])
            ->addColumn('except_settle_estimate_amount', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '未结算 扣除已结算的estimate_amount'])
            ->update();
    }


    public function down()
    {
        $this->table('agent_finance_daily')
            ->removeColumn('settle_amount')
            ->removeColumn('order_num')
            ->removeColumn('except_settle_estimate_amount')
            ->removeColumn('trade_amount');
    }
}
